package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysDiscountMapper;
import com.ruoyi.system.domain.SysDiscount;
import com.ruoyi.system.service.ISysDiscountService;

/**
 * 折扣记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class SysDiscountServiceImpl implements ISysDiscountService 
{
    @Autowired
    private SysDiscountMapper sysDiscountMapper;

    /**
     * 查询折扣记录
     * 
     * @param discountId 折扣记录主键
     * @return 折扣记录
     */
    @Override
    public SysDiscount selectSysDiscountByDiscountId(Long discountId)
    {
        return sysDiscountMapper.selectSysDiscountByDiscountId(discountId);
    }

    /**
     * 查询折扣记录列表
     * 
     * @param sysDiscount 折扣记录
     * @return 折扣记录
     */
    @Override
    public List<SysDiscount> selectSysDiscountList(SysDiscount sysDiscount)
    {
        return sysDiscountMapper.selectSysDiscountList(sysDiscount);
    }

    /**
     * 新增折扣记录
     * 
     * @param sysDiscount 折扣记录
     * @return 结果
     */
    @Override
    public int insertSysDiscount(SysDiscount sysDiscount)
    {
        return sysDiscountMapper.insertSysDiscount(sysDiscount);
    }

    /**
     * 修改折扣记录
     * 
     * @param sysDiscount 折扣记录
     * @return 结果
     */
    @Override
    public int updateSysDiscount(SysDiscount sysDiscount)
    {
        return sysDiscountMapper.updateSysDiscount(sysDiscount);
    }

    /**
     * 批量删除折扣记录
     * 
     * @param discountIds 需要删除的折扣记录主键
     * @return 结果
     */
    @Override
    public int deleteSysDiscountByDiscountIds(Long[] discountIds)
    {
        return sysDiscountMapper.deleteSysDiscountByDiscountIds(discountIds);
    }

    /**
     * 删除折扣记录信息
     * 
     * @param discountId 折扣记录主键
     * @return 结果
     */
    @Override
    public int deleteSysDiscountByDiscountId(Long discountId)
    {
        return sysDiscountMapper.deleteSysDiscountByDiscountId(discountId);
    }
}
